{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 15 元祖"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.【判断】Python语句“x = \"a\",\"b\",\"c\"”中，x是一个元组。（ ）\n",
    "\n",
    "A.√  \n",
    "B.×  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：A"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.【选择】执行下列Python语句会报错的是：（ ）  \n",
    "`\n",
    "myTuple = (1,2,3,4)\n",
    "myList = [1,2,3,4]`\n",
    "\n",
    "A.myTuple[3] = 30  \n",
    "B.myList[3] = 30  \n",
    "C.myTuple[1:3]  \n",
    "D.myList[1:3]  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：A"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.【填空】使用Python内置函数，计算元组myTuple的语句是：（ ）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：len(myTuple)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.【选择】下列关于Python的描述错误的是：（ ）\n",
    "\n",
    "A.元组是内部元素有先后顺序，且不可变的容器  \n",
    "B.列表是内部元素有先后顺序，且可变的容器  \n",
    "C.对元组内部元素进行排序使用的是sort()  \n",
    "D.计算元组内某数字的频次使用的是count()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：C"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.【填空】下列语句运行结果是：（ ）  \n",
    "`\n",
    "myTuple = tuple(\"Python\")\n",
    "i1,i2,i3,i4,i5,i6 = myTuple\n",
    "print(i3)`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：t"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.【填空】下列语句运行结果是：（ ）  \n",
    "`\n",
    "def func(args1,*args2,args3 = 3):\n",
    "    print(args2)\n",
    "func(\"a\",1,2,\"4\")`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：(1, 2, '4')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
